﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace Lotto.Core
{
    public partial class LottoCtrl : UserControl
    {
        /// <summary>
        /// Ball brush dependency property.
        /// </summary>
        public static readonly DependencyProperty BallBrushProperty =
            DependencyProperty.Register(
                "BallBrush",
                typeof(Brush),
                typeof(LottoCtrl),
                null);

        /// <summary>
        /// Ball brush.
        /// </summary>
        public Brush BallBrush
        {
            get { return (Brush)GetValue(BallBrushProperty); }
            set { SetValue(BallBrushProperty, value); }
        }


        /// <summary>
        /// Constructor
        /// </summary>
        public LottoCtrl()
        {
            InitializeComponent();
        }

        public void SetNumbers(int[] numbers)
        {
            if (numbers.Length != 6)
                throw new ArgumentException("Invalid array length");

            this.winningNumber1.Value = numbers[0];
            this.winningNumber2.Value = numbers[1];
            this.winningNumber3.Value = numbers[2];
            this.winningNumber4.Value = numbers[3];
            this.winningNumber5.Value = numbers[4];
            this.winningNumber6.Value = numbers[5];
        }
    }
}
